<script>
  const endpoint = 'https://jsonplaceholder.typicode.com/users'
  const fetchUsers = () => {
    fetch(endpoint)
      .then(response => {
        if (!response.ok) throw new Error('Network response was not ok')
        return response.json()
      })
      .then(data => {
        console.log(data)
      })
      .catch(error => {
        console.error('error:', error)
      })
  }

  fetchUsers()
</script>
